package com.briup.cms.exception;

import com.briup.cms.utils.Message;
import com.briup.cms.utils.MessageUtil;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Administrator
 * @version 1.0
 * @Description
 * @date 2021/7/17 19:20
 */

@RestController
public class NotFoundException implements ErrorController {
    @RequestMapping({"/error"})
    public Message error(HttpServletRequest request) {
        return MessageUtil.error("您访问的资源不存在："+ request.getRequestURI());
    }

    public String getErrorPath() {
        return "/error";
    }
}
